package cn.gcjxsc.common.util;

import cn.gcjxsc.common.data.notify.order.ResultHandleData;
import org.apache.commons.codec.digest.DigestUtils;

/**
 * @author pumbaa
 * @since 1.0
 */
public class PaymentResultUtil {

    public static String md5(ResultHandleData data, String key) {
        return DigestUtils.md5Hex(data.getTradeNo()+data.getOutTradeNo()+data.getSn()+key);
    }

    public static boolean verifySign(String sign, ResultHandleData data, String key) {
        return sign.equals(md5(data, key));
    }
}
